//
//  ZZBaseVC.swift
//  QMXK
//
//  Created by jenkin on 2018/12/3.
//  Copyright © 2018年 jenkin. All rights reserved.
//

import UIKit
import SnapKit

typealias ClickSaveBlock = (Dictionary<String, Any>?) -> Void

class ZZBaseVC: UIViewController {
    
    let rate:CGFloat = CommenConst.shareCommentConst.KSIZE(1)
    let navH = CommenConst.shareCommentConst.KNAVH()
    let bottomH = CommenConst.shareCommentConst.KBottomH()
    let screenW = CommenConst.KScreenW
    let screenH = CommenConst.KScreenH
    var myNavBar:UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    func setUI(){
        self.navigationController?.setNavigationBarHidden(true, animated: false)
        self.view.backgroundColor = ColorConst.shareColorConst.viewBackColor()
        self.automaticallyAdjustsScrollViewInsets = false
        self.view.backgroundColor = ColorConst.shareColorConst.viewBackColor()
        
        self.myNavBar = UIView.init()
        self.view.addSubview(self.myNavBar)
        self.myNavBar.snp.makeConstraints { (make) in
            make.left.right.top.equalTo(0)
            make.height.equalTo(self.navH)
        }
        
        let backBtn = UIButton.init()
        backBtn.setImage(UIImage.init(named: "back"), for: UIControl.State.normal)
        backBtn.setImage(UIImage.init(named: "back"), for: UIControl.State.selected)
        backBtn.addTarget(self, action: #selector(backAction(sender:)), for: UIControl.Event.touchUpInside)
        self.myNavBar.addSubview(backBtn)
        backBtn.snp.makeConstraints { (make) in
            make.left.equalTo(12)
            make.width.height.equalTo(self.rate * 25)
            make.bottom.equalTo(-12)
        }
    }
    
    @objc func backAction(sender: UIButton){
        
        self.navigationController?.popViewController(animated: true)
        
    }
    
}
